﻿@model 软件工程实验.Models.LoginModel

<main>
    <h2>Login</h2>

    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()

        <div class="form-group">
            @Html.LabelFor(m => m.Email)
            @Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
        </div>

        <div class="form-group">
            @Html.LabelFor(m => m.Password)
            @Html.PasswordFor(m => m.Password, new { @class = "form-control" })
        </div>

        <button type="submit" class="btn btn-primary">Login</button>
    }

    @if (!string.IsNullOrEmpty(ViewBag.ErrorMessage))
    {
        <div class="alert alert-danger">@ViewBag.ErrorMessage</div>
    }
</main>